package com.auction.util;

import com.tencentyun.TLSSigAPIv2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class UserSigUtil {

    @Value("${tencent.im.sdkAppId}")
    Long SdkAppId;

    @Value("${tencent.im.secretKey}")
    String SdkAppSecret;

    public String generateUserSig(String userId) {
        TLSSigAPIv2 tlsSigAPI = new TLSSigAPIv2(SdkAppId,SdkAppSecret);
        // 签名有效期（单位：秒），建议设置为 24 小时
        return tlsSigAPI.genUserSig(userId, 86400);
    }
}
